import { createRouter, createWebHistory } from 'vue-router';
import Layout from '../src/views/Layout.vue';
import HomeView from '../src/views/HomeView.vue';
import ProductView from '../src/views/main/Product.vue';
import GoodsParams from '../src/views/main/Params.vue';
import ADCategory from './../src/views/main/ADCategory.vue';
import LoginView from '../src/views/LoginView.vue';

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      { 
        path: '/',
        component: HomeView 
      },
      {
        path: '/product', 
        component: ProductView 
      },
      { 
        path: '/params', 
        component: GoodsParams 
      },
      { 
        path: '/ad', 
        component: ADCategory 
      },
    ]
  },
  { 
    path: '/login', 
    component: LoginView 
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes
});

export default router;
